package com.lzy.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="TBIMCATALOG")
public class IMFolder implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GenericGenerator(name = "idGenerator", strategy = "native")
	@GeneratedValue(generator = "idGenerator")
	@Column(name="CatalogID")
	private int typeID ;
	
	@Column(name="CatalogName",length=64)
	private String typeName ;
	
	@Column(name="FartherCatalogID")
	private int parentId;
	
//	@ManyToOne
//	@NotFound(action=NotFoundAction.IGNORE)
//	@JoinColumn(name="FARTHERID")
//	private IMFolder parent;

//	@OneToMany(fetch=FetchType.LAZY)
//	@JoinColumn(name="FARTHERID")
//	private List<IMFolder> children = new ArrayList<IMFolder>();
//	
//	public List<IMFolder> getChildren() {
//		return children;
//	}
//
//	public void setChildren(List<IMFolder> children) {
//		this.children = children;
//	}
	
	public IMFolder() {
	}
	
	public IMFolder(int typeID, String typeName, int parentId) {
		this.typeID = typeID;
		this.typeName = typeName;
		this.parentId = parentId;
	}

	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	public int getTypeID() {
		return typeID;
	}

	public void setTypeID(int typeID) {
		this.typeID = typeID;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

//	public IMFolder getParent() {
//		return parent;
//	}
//
//	public void setParent(IMFolder parent) {
//		this.parent = parent;
//	}
	
}
